package com.excel.write;

import com.excel.entity.CCell;

import java.util.LinkedList;
import java.util.List;

public class CRow {

    private List<CCell> cells;

    public List<CCell> getCells() {
        return cells;
    }

    public void setNames(List<CCell> cells) {
        this.cells = cells;
    }


    public static final class CRowBuilder {
        private List<CCell> cells;

        private CRowBuilder() {
            cells = new LinkedList<>();
        }

        public static CRowBuilder aCRow() {
            return new CRowBuilder();
        }

        public CRowBuilder withCell(CCell cell) {
            this.cells.add(cell);
            return this;
        }

        public CRow build() {
            CRow cRow = new CRow();
            cRow.cells = this.cells;
            return cRow;
        }
    }
}
